<?
   function m_init() {
      global $modulo, $acao, $msg, $contents;
   
      if (empty($_GET['f']))
         redir('index.php');
         
      $f = secure_path($_GET['f']);
      
      $contents = file_get_contents("datasets/{$f}.csv");
         
      $_SESSION['data'] = get_tabular($contents);
      $_SESSION['filtro'] = array();
      $_SESSION['type'] = array();
      $_SESSION['coord'] = array();
         
      redir('index.php?m=tratar');
   }
   
   function m_run() {
      global $modulo, $acao, $msg, $contents, $tab;
      
      if (!empty($_SESSION['data'])) {
         ?>
         <table>
         <? foreach ($_SESSION['data'] as $linha) { ?>
         <tr>
            <? foreach ($linha as $col) { ?>
               <td><?= $col ?></td>
            <? } ?>
         </tr>
         <? } ?>
         </table>
         <?
      }
   }
?>